package com.ruoyi.web.controller;

import com.ruoyi.common.sys.service.SysDictDataService;
import com.ruoyi.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 字典
 *
 * @author tanxingxian
 * @date 2021-12-27 11:12
 */
@RestController
@RequestMapping("/dict")
public class DictController {

    @Autowired
    private SysDictDataService sysDictDataService;

    /**
     * 根据字典类型获取字典数据列表
     */
    @GetMapping("/dictList")
    public ResponseResult dictList(@RequestParam("dictType") String dictType) {
        return ResponseResult.success(sysDictDataService.getDataList(dictType));
    }

}
